﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PloobsEngine.SceneControl;
using Microsoft.Xna.Framework;

namespace Etapa1.ComercioEspacial
{
    public class MovimentacaoPlaneta : IObjectAtachtment
    {
        public float raioDoCentroDoSistema;
        public IObject representacaoPlaneta;
        public float speed;
        public Vector3 posicaoInicialPLaneta;

        public void Update(IObject obj, GameTime gt)
        {
           double x = posicaoInicialPLaneta.X + raioDoCentroDoSistema * Math.Sin(gt.TotalGameTime.TotalMilliseconds/speed);
           double z = posicaoInicialPLaneta.Z + raioDoCentroDoSistema * Math.Cos(gt.TotalGameTime.TotalMilliseconds / speed);
           representacaoPlaneta.Position = new Vector3((float) x, posicaoInicialPLaneta.Y, (float)z );
        }
    }
}
